#include <iostream>

using namespace std;

/*
 * 设计一个立方体类  求立方体的面积和体积
 *      用全局函数和成员函数判断两个立方体是否相等
 */

class Cube{
public:
    float c_L;
    float c_W;
    float c_H;

    void getS(){
        cout << "面积：" << c_W*c_L*2+c_W*c_H*2+c_L*c_H*2 << endl;
    }

    void getV(){
        cout << "体积：" << c_W*c_L*c_H << endl;
    }

    void isEqual(Cube c) {
        if(c.c_H==c_H && c.c_L == c_L && c.c_W == c_W) {
            cout << "相等" << endl;
        } else{
            cout << "不相等" << endl;
        }
    }
};

void isSameCube(Cube c1, Cube c2) {
    if(c1.c_W == c2.c_W && c1.c_L == c2.c_L && c1.c_H == c2.c_H){
        cout << "相等" << endl;
    } else{
        cout << "不相等" << endl;
    }
}

int main() {
    Cube c1;
    Cube c2;
    c1.c_H = 5.2;
    c1.c_L = 4;
    c1.c_W = 3.6;

    c2.c_H = 4.2;
    c2.c_L = 4;
    c2.c_W = 3.6;

    c1.getS();
    c1.getV();
    c1.isEqual(c2);

    c2.getV();
    c2.getS();
    isSameCube(c1, c2);

    return 0;
}
